<?php

namespace Fang\CouponBundle\Form\User;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
/**
*表单类
**/
class UserRegister extends AbstractType
{
	/**
	*创建表单的主体
	**/
	public function buildForm(FormBuilderInterface $builder, array $options)
	{
	  //参数一字段名，参数二字段类型，参数三配置
	  $builder->add("username", TextType::class, array("label"=>"Username", "required"=>true,));
	  $builder->add("password", RepeatedType::class, array(
	  	'type' => PasswordType::class,
	  	"invalid_message"=>"the password must match",
	  	"required"=>true,
	  	"first_options" => array("label"=>"Password"),
	  	"second_options" => array("label"=>"Repeat Password"),
	  ));
	  $builder->add("save", SubmitType::class);
	}
	/**
	*非必须
	**/
}